<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
            "http://www.w3.org/TR/REC-html40/loose.dtd">
<HTML>
<HEAD>



<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<META name="GENERATOR" content="hevea 1.08">
<LINK rel="stylesheet" type="text/css" href="libman.css">
<TITLE>
General Guidelines for the Use of the IC library
</TITLE>
</HEAD>
<BODY >
<A HREF="libman018.html"><IMG SRC ="previous_motif.gif" ALT="Previous"></A>
<A HREF="libman016.html"><IMG SRC ="contents_motif.gif" ALT="Up"></A>
<A HREF="libman020.html"><IMG SRC ="next_motif.gif" ALT="Next"></A>
<HR>

<H2 CLASS="section"><A NAME="htoc46">3.3</A>&nbsp;&nbsp;General Guidelines for the Use of the IC library</H2>
Whilst IC has been designed to provide a flexible, consistent and yet
powerful framework for many sorts of constraint satisfaction
problems, it can not be all things to all people.<BR>
<BR>
There are circumstances under which IC will not propagate all possible
information, for reasons of efficiency.<BR>
<BR>
It is the purpose of this section to point out ways that may help IC
to solve problems more efficiently.<BR>
<BR>
Typical constraint satisfaction problems are solved by iteratively
propagating information from basic constraints until no more
propagation can take place (i.e. a fixed point has been reached), and
then reducing the domain of a variable so as to prompt more
propagation.<BR>
<BR>
As with most constraint solvers the propagation provided by the
builtin constraints is rarely able to solve large problems completely
without the need for some form of search. A number of factors affect
the speed of the propagation phase.
<OL CLASS="enumerate" type=1><LI CLASS="li-enumerate">
The size of the initial domains.
Smaller domains typically result in propagation reaching a fixed point
sooner. So give explicit initial domains to as many variables as possible.
<LI CLASS="li-enumerate">Integer domains allow more propagation.
An important point to note here is that (as in mathematics) IC treats
integers as a strict subset of the reals, and as such the integer
domain <CODE>0 .. 100</CODE> contains significantly fewer values than the
real domain <CODE>0.0 .. 100.0</CODE>. With this in mind, IC attempts to
infer integrality where possible (e.g. the sum of two integer variables
is constrained to be integer), however integer domains (where
applicable) should be used in user code.<BR>
<BR>
The difference becomes apparent when dealing with strict inequalities, for example.
<PRE CLASS="verbatim">
[eclipse 4]: reals([X]), X $&gt; 5.

X = X{5.0 .. 1.0Inf}


Delayed goals:
        ic : (X{5.0 .. 1.0Inf} &gt; 5)
Yes (0.00s cpu)
</PRE>Note that the lower bound of X is still five despite the fact that X
has been constrained to be strictly greater than five. Further note
the presence of a delayed goal which will fail should X be constrained
to be exactly five.
<PRE CLASS="verbatim">
[eclipse 5]: integers([X]), X $&gt; 5.

X = X{6 .. 1.0Inf}
Yes (0.00s cpu)
</PRE>In this example since X is known to be integral, the lower bound of X
can be set to 6, as there are no integers between five and six.
</OL>
<HR>
<A HREF="libman018.html"><IMG SRC ="previous_motif.gif" ALT="Previous"></A>
<A HREF="libman016.html"><IMG SRC ="contents_motif.gif" ALT="Up"></A>
<A HREF="libman020.html"><IMG SRC ="next_motif.gif" ALT="Next"></A>
</BODY>
</HTML>
